﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QuestionnaireSubjectEdit.aspx.cs" Inherits="ZX.TR.Web.QuestionnaireSubjectEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
    </style>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table align="center" width="300px">
            <tr height="30px">
                <td>
                    问卷名称
                </td>
                <td>
                    <asp:Label ID="lblQName" runat="server"></asp:Label>
                </td>
            </tr>
            <tr height="30px">
                <td>
                    题目名称
                </td>
                <td>
                    <asp:Label ID="lblSName" runat="server"></asp:Label>
                </td>
            </tr>
            <tr height="30px">
                <td>
                    序号
                </td>
                <td>
                    <asp:TextBox ID="txtSeq" onpaste="return false" style="ime-mode:disabled "
                            onkeypress="if((event.keyCode<48 || event.keyCode>57) && event.keyCode != 46) event.returnValue = false;" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr height="30px">
                <td>
                    分数
                </td>
                <td>
                    <asp:TextBox ID="txtNumber" onkeyup="if(isNaN(value))execCommand('undo')"
                            onafterpaste="if(isNaN(value))execCommand('undo')" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr height="30px">
                <td>
                    是否允许跳过
                </td>
                <td>
                    <asp:DropDownList ID="drpJump" runat="server" Width="155" AutoPostBack="True" 
                        onselectedindexchanged="drpJump_SelectedIndexChanged">
                        <asp:ListItem Value="Y">是</asp:ListItem>
                        <asp:ListItem Value="N">否</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <asp:HiddenField ID="hiddenJump" runat="server" />
            <asp:HiddenField ID="hiddenId" runat="server" />
        </table>
    </div>
    </form>
</body>
<script type="text/javascript">
    function Save() {
        var QuestionnaireSubjectId = document.getElementById("hiddenId").value
        var lstValue = document.getElementById("txtSeq").value + "," + document.getElementById("txtNumber").value + "," + document.getElementById("hiddenJump").value;
        if (QuestionnaireSubjectId != "" || lstValue != "") {
            var url = "../Extend/AjaxData/DataProcessin.aspx?action=Update&entity=TrQuestionnaireSubject&id=" + QuestionnaireSubjectId + "&ids=" + lstValue + "";
            YAHOO.util.Connect.asyncRequest('POST', url, {
                success: function (res) {
                    var inventory;
                    try {
                        inventory = res.responseText;
                        if (inventory == 1) {
                            alert("保存成功!");
                            parent.closeWin(2);
                        } else {
                            alert("保存失败!");
                        }
                    }
                    catch (e) {
                    }
                    finally {
                    }
                },
                failure: function (error) {
                    alert("读取数据错误：" + error.statusText);
                }
            }, null);
        }
    }
</script>
</html>
